﻿#ifndef ENROLLFINGERPRINTDIALOG_H
#define ENROLLFINGERPRINTDIALOG_H

#include <QDialog>
#include "ZKFingerReader/FingerprintReader.h"
#include "ZKFingerReader/FingerprintCacheDB.h"
#include "ZKFingerReader/FingerprintEnroll.h"
namespace Ui {
class EnrollFingerprintDialog;
}

class EnrollFingerprintDialog : public QDialog
{
    Q_OBJECT

public:
    explicit EnrollFingerprintDialog(QWidget *parent = 0);
    ~EnrollFingerprintDialog();
    QString name();
    QString password();
    int user_id();
    QByteArray fpTemplate();
    void accept() override;
private slots:
    void onFingerprintRejected();
    void onFingerprintAccepted();
    void onEnrollFinished(QByteArray regTemplate);
    void onFingerprintReceived(QImage image, QByteArray fpTemplate);
    void onEnroll();
private:
    Ui::EnrollFingerprintDialog *ui;
    bool m_fpOk;
    ZKFP::FingerprintCacheDB m_cacheDB;
    ZKFP::FingerprintEnroll m_enroll;

    QByteArray m_regTemplate;
    ZKFP::FingerprintReader m_reader;

    QString m_name;
    QString m_password;
    int m_user_id;
};

#endif // ENROLLFINGERPRINTDIALOG_H
